<style>
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
background-color: #fff;
border-bottom: 2px solid #f7762e;
color: #555;
cursor: default;
border-left:none;
border-top:none;
border-right:none;
}	
.nav.nav-tabs {
  margin-left: 8px;
  width: 95%;
}
#myTab > li {
  width: 50%;
  text-align: center;
}
</style>

<section class="reg">
<ul class="nav nav-tabs" id="myTab">
  <li class="active"><a href="#home" data-toggle="tab">短信找回</a></li>
  <li><a href="#profile" data-toggle="tab">邮箱找回</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="home">
  	<div class="form">
		<form action='{url:/simple/find_password_mobile}' method='post'>
			<input type="hidden" name='callback' />
			<ul>

				<li class="user-info">
					<input class='form-control' placeholder="用户名" initmsg="输入正确" type="text" name='username' pattern="^[\w\u0391-\uFFE5]{2,20}$" alt="填写2-20个字符" />
				</li>

				<li class="user-info">
					<input class='form-control' placeholder="手机号" initmsg="输入正确" type="text" name="mobile" alt="填写正确格式" />
				</li>

				<a href="javascript:sendMessage();" class="link">发送手机验证码</a>

				<li class="user-info">
					<input class='form-control' placeholder="手机验证码" initmsg="输入正确" type="text" name="mobile_code" alt="填写正确格式" />
				</li>

				<li class="enter">
				<button type="submit" class='btn btn-xs btn-primary col-lg-5 col-xs-5'>找回密码</button>
				</li>
			</ul>
		</form>
</div>


  </div>
  <div class="tab-pane" id="profile">
  	
<div class="form">
		<form action='{url:/simple/find_password_email}' method='post'>
			<input type="hidden" name='callback' />
			<ul>

				<li class="user-info">
					<input class='form-control' placeholder="用户名" initmsg="输入正确" type="text" name='username' pattern="^[\w\u0391-\uFFE5]{2,20}$" alt="填写2-20个字符" />
				</li>

				<li class="user-info">
					<input class='form-control' placeholder="邮箱" initmsg="输入正确" type="text" name='email' pattern="email" alt="填写正确格式" />
				</li>

				<li class="enter">
				<button type="submit" class='btn btn-xs btn-primary col-lg-5 col-xs-5'>找回密码</button>
				</li>
			</ul>
		</form>
</div>



  </div>

</div>

<script>
  $(function () {
    $('#myTab a:last').tab('show')
  })

  //发送短信码
function sendMessage()
{
	var username = $('#mobileWay [name="username"]').val();
	var mobile   = $('#mobileWay [name="mobile"]').val();
	$.get("{url:/simple/send_message_mobile}",{"username":username,"mobile":mobile},function(content){
		if(content == 'success')
		{
			alert('发送成功，请查看您的手机');
		}
		else
		{
			alert(content);
			return;
		}
	});
}
</script>
	
</section>

